﻿public class NetEvent_Visit : NetEvent
{
    public static NetEvent_Visit NewEvent()
    {
        return new NetEvent_Visit();
    }

    protected override ISerialize NewData() => new VisitData();


    protected override void Excuate(ISerialize data)
    {
        VisitData updateData = data as VisitData;

        GameDebug.Log($"更新Visit：{updateData?.visitor?.userId} ");

        if(updateData.visitor != null)
            MGame.instance.MUser.AddVisitor(updateData.visitor);
        if (updateData.myVisit != null)
            MGame.instance.MUser.AddMyVisit(updateData.myVisit);
    }

}
